<!-- 文献精析 -->
<script lang="ts">
export default {
  name: "DocumentAnalysis",
};
</script>
<template>
  <div class="page-box h100 display-flex czbj">
    <p class="title-label mb10">
      文献精析
    </p>
    <div>
      <dxtable :formJson="formJson" :headBtn="headBtn" :dataJson="dataJson" :portUrl="portUrl" :qx="qx" ref="databale">
      </dxtable>
    </div>

    <n-modal v-model:show="showModal" preset="card" class="Stock-diagnosis">
      <template #header>
        <div>动态KV</div>
      </template>
      <div class="cxvsdgfrtrer">
        <zd :id="219" @saveSuccess="saveSuccess"></zd>
      </div>
      <template #action>
        <div class="tr">
          <n-button @click="showModal = false"> 关闭 </n-button>
        </div>
      </template>
    </n-modal>
  </div>
</template>
<script lang='ts' setup>
import { rowDark } from "naive-ui/es/legacy-grid/styles";
import dxtable from "../../components/util/dxtable.vue";
import sort from "../../components/util/sort.vue";
import zd from "../dxgj/components/zd.vue"
import { dxget, dxpost, qurl, hf, transferTimeYMDHm } from "../../util/index";
import { h, ref, reactive, onBeforeUpdate } from "vue";
import videoplay from "./videoplay.vue"
import { wxfl } from "./public"


const props = defineProps({
  pup: { type: String },
});
const showModal = ref(false)
const videourl = ref()
let headBtn = [{
  name:"设置动态KV",
  jy:true,
  clickFun:()=>{
    showModal.value = true
  }
}];
const zdList = ref()
const databale = ref();
const typeli = ref([])
const initeer = () => {
  databale.value.initDataExpose();
};
const saveSuccess=  ()=>{
  showModal.value = false
    window.$message.success("保存成功")
}
const emit = defineEmits(["callBack"]);
// 弹窗公用该列表
let dataJson = reactive([
  {
    title: "id",
    key: "id",
    width: 50,
  },

  {
    title: "名称",
    search: true, // 是否在搜索栏展示
    key: "title",
    width: 400,
  },
  {
    title: "类别",
    search: true, // 是否在搜索栏展示
    type: "select",
    options: [{
      label: "All",
      value: '',
    }, ...wxfl],
    key: "fenlei",
  }, {
    title: "关键词",
    key: "erjigjc",
    search: true, // 是否在搜索栏展示
    render(row){
      try{
        return h("span",{class:"ls"},'#'+row.erjigjc.split(",").join(" #"))
      }catch(e){
        return '--'
      }
    }
  },

  {
    title: "文献链接",
    key: "url",
    width: 100,
    render(row) {
      return h("span", {
        class: "ls sz", onClick: () => {
          open(row.url)
        }
      }, "浏览")
    }
  },

  {
    title: "排序",
    width: 100,
    render(row) {
      row.databaseName = "DocumentAnalysis";
      return h(sort, {
        row,
        onCallBack: () => {
          initeer();
        },
      });
    },
  },
  {
    title: "添加时间",
    key: "addTime",
    width: "140",
    type: "daterange",
  },
]);
let portUrl = "xjyx/DocumentAnalysis?type=1";
const qx = {
  DeletePermissionID: "DocumentAnalysisdel", //删除
  EditPermissionIdentifier: "DocumentAnalysisbj", // 编辑
  NewPermissionIdentifier: "DocumentAnalysisxz", // 新建
  ViewPermissionID: "DocumentAnalysisck", // 查看
};

let formJson = reactive([


  {
    title: "名称",
    key: "title",
    type: "input",
    span: 24,
    required: true,
  },
  {
    title: "类别",
    key: "fenlei",
    type: "select",
    options: wxfl,
    required: true,
    callBack:(data,model)=>{
      model['erjigjc']= ""
      formJson[2].options =[]
      formJson[2].ishide = true 
      if(data.junior.length>0){
        formJson[2].ishide = false
        formJson[2].options = data.junior
      }
    }
  }, {
    title: "二级关键词",
    key: "erjigjc",
    type: "select",
    options: [],
    multiple:true,
    ishide:true,
    val:"",
    span: 24,
  },


  

  {
    title: "封面",
    key: "cover",
    type: "img",
    span: 24,
  },
  {
    title: "文献地址",
    key: "url",
    type: "input",
    required: true,
    span: 24,
  },
])





</script>
  
  
  